      subroutine Residual_Assembly(ie,F1_2)
	  use global
      Implicit none
	  integer :: kloc_e(2),ie,nelt
	  real(8) :: F1_2(2,3) ,Re(2,3)
	  nelt=nnt-1
	  kloc_e=[ie,ie+1]
	  Re(1,:)=-0.5D0*Delta_t*(F1_2(1,:)+F1_2(2,:))
	  Re(2,:)=-Re(1,:)
	  
	  Resid(kloc_e,:)=Resid(kloc_e,:)+Re
	  if (ie==1) then
	    Resid(1,:)=Resid(1,:)+Delta_t*F1_2(1,:)
	  endif
	  if (ie==nelt) then
	    Resid(nnt,:)=Resid(nnt,:)-Delta_t*F1_2(2,:)
	  endif

      end subroutine